using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using SailHero.Soft.FrameWork.Models;

namespace SailHero.Soft.FrameWork.Mapping.AuthCodeDB
{
    public class Sys_RolePermissionMap : EntityTypeConfiguration<Sys_RolePermission>
    {
        public Sys_RolePermissionMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.RoleID)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.ModelID)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Sys_RolePermission");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.RoleID).HasColumnName("RoleID");
            this.Property(t => t.ModelID).HasColumnName("ModelID");
        }
    }
}
